package com.baoyouqun.service;

import cn.hutool.core.lang.tree.Tree;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baoyouqun.domain.Query.LeopardFriendDistQuery;
import com.baoyouqun.domain.VO.*;
import com.baoyouqun.domain.cmd.BatchLeopardFriendStatusCmd;
import com.baoyouqun.domain.cmd.BatchUserStatusCmd;
import com.baoyouqun.domain.cmd.SingleUserStatusCmd;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface LeopardFriendService {
    @Transactional(rollbackFor = Exception.class)
    Response batchDisEnable(BatchLeopardFriendStatusCmd cmd);

    SingleResponse<DuplicateCheckVO> checkDuplicateCellphone(String cellphone);

    List<String> getDuplicateUserIdsByCellphone(String cellphone);

    /**
     * 获取核心统计数据（总人数/在线/VIP/收入等）
     */
    SingleResponse<LeopardFriendCoreStatVO> getCoreStat();

    /**
     * 地区用户统计（简化入参）
     */
    SingleResponse<List<Tree<String>>> getAreaUserStat();

    /**
     * 获取需求分布（按需求cityCode分组，区分类型）
     */
    SingleResponse<List<Tree<String>>> getDemandDistByType();

    /**
     * 获取VIP会员动态（前500条，按开通时间倒序）
     */
    SingleResponse<IPage<VipDynamicVO>> getVipDynamic(LeopardFriendDistQuery query);

    /**
     * 获取新豹友动态（前500条，按注册时间倒序）
     */
    SingleResponse<IPage<NewUserDynamicVO>> getNewUserDynamic(LeopardFriendDistQuery query);

    /**
     * 导出豹友地区分布Excel
     */
    void exportAreaDistExcel(String cityCode, HttpServletResponse response) throws IOException;

    /**
     * 导出需求分布Excel
     */
    void exportDemandDistExcel(LeopardFriendDistQuery query, HttpServletResponse response) throws IOException;

    /**
     * 导出 VIP member dynamics Excel
     */
    void exportVipDynamicExcel(LeopardFriendDistQuery query, HttpServletResponse response) throws IOException;

    /**
     * export new leopard friend dynamics Excel
     */
    void exportNewUserDynamicExcel(LeopardFriendDistQuery query, HttpServletResponse response) throws IOException;


    /**
     * 2. 单个豹友启用/禁用（独立实现）
     */
    Response updateSingleUserStatus(SingleUserStatusCmd cmd);

    /**
     * 3. 批量豹友启用/禁用（独立实现）
     */
    Response updateBatchUserStatus(BatchUserStatusCmd cmd);

    /**
     * 5. 批量导入豹友（独立实现）
     */
    SingleResponse<LeopardFriendImportVO> importLeopardFriends(MultipartFile file) throws IOException;


}